import { HomeComponent } from './pages/home/home.component';
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { LoginComponent } from './pages/login/login.component';
import { UserListComponent } from './pages/home/user/user-list/user-list.component';
import {UserCreateComponent} from './pages/home/user/user-create/user-create.component';
import {CateListComponent} from './pages/home/cate/cate-list/cate-list.component';
import {CateCreateComponent} from './pages/home/cate/cate-create/cate-create.component';
import {CateEditComponent} from './pages/home/cate/cate-edit/cate-edit.component';

const routes: Routes = [
  { path: 'home' , component: HomeComponent,
    children: [
      {path: 'user/list', component: UserListComponent},
      {path: 'user/create', component: UserCreateComponent},
      {path: 'cate/list', component: CateListComponent},
      {path: 'cate/create', component: CateCreateComponent},
      {path: 'cate/update', component:CateEditComponent}
    ]
  },
  { path: 'login', component: LoginComponent }
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule {}
